soundHandler = playSound ( "musica.mp3" )
local samples = 256
loadstring(exports.dgs:dgsImportFunction())()

local sw,sh = guiGetScreenSize()
local px,py = sw/1366,sh/768

image = dxCreateTexture( "logo.png" ,"argb", false, "clamp" )
function onSoundPlayRender ( )
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 2 )
	    if ( soundFFT ) then
                for i,v in ipairs(soundFFT) do

                local pos1 = (500*px)-(math.sqrt ( soundFFT[i]*1024 ))*2
                local pos2 = (50*py)-(math.sqrt ( soundFFT[i]*1024 ))*2
                local pos3 = (366*px)+(math.sqrt ( soundFFT[i]*1024 ))*4
                local pos4 = (368*py)+(math.sqrt ( soundFFT[i]*1024 ))*4
                dxDrawImage ( pos1,pos2,pos3,pos4, image, angle, 0, -120 )
              --  dxDrawText ( "clickerMTA",0*px,0*py,1366*px,768*py, tocolor ( 255, 0, 0, 255 ), 3+(math.sqrt ( soundFFT[i] ) * 2), "pricedown","center","center" )
            end
        end
end
addEventHandler ( "onClientRender", getRootElement(), onSoundPlayRender )